<template>
	<!--pages/detail/detail.wxml -->
	<view class="detailContainer">
		<view class="ad_titile">
			<text class="company">{{guideInfo.guideName}}</text>
		</view>
		<view class=" menu-avatar">
			<view class="cu-item">
				<view class="content">
					<view class="text-gray text-sm ">
						<view class="text-cut" style="margin-right: 32px;text-align: end;">
							{{startTime}}
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="ad_context">
			<!-- <rich-text :nodes="context"></rich-text> -->
			<view class="flex margin-top justify-between">
				<view class="text-gray">事项类型</view>
				<view class="text-gray">{{guideInfo.guideType == '1001'?'普通事项':'其他事项'}}</view>
			</view>
			<view class="flex margin-top justify-between">
				<view class="text-gray">事项名称</view>
				<view class="text-gray">{{guideInfo.guideName}}</view>
			</view>
			<view class="flex margin-top-xs justify-between">
				<view class="text-gray">联系人</view>
				<view class="text-gray">{{guideInfo.person}}</view>
			</view>
			<view class="flex margin-top-xs justify-between">
				<view class="text-gray">咨询电话</view>
				<view class="text-gray">{{guideInfo.link }}</view>
			</view>
			<view class="flex margin-top-xs justify-between">
				<view class="text-gray">是否开启预约</view>
				<view class="text-gray">{{guideInfo.subscribe == '1001'?'是':'否' }}</view>
			</view>
			<jyf-parser :html="context" ref="article"></jyf-parser>
		</view>
	</view>
</template>

<script>


	import url from '../../constant/url.js'
	import {queryGovWorkGuide} from '../../api/govGuide/govGuideApi.js'
	import {
		getAreaId
	} from '../../api/area/areaApi.js'
	
	import conf from '../../conf/config.js'
	
	import {replaceImgSrc} from  '../../lib/java110/utils/ImageUtil.js';
	
	import jyfParser from "@/components/jyf-parser/jyf-parser";
	export default {
		data() {
			return {
				guideInfo:{},
				wgId: '',
				title: '',
				caId: '',
				src: '',
				userName: '',
				startTime: '',
				context: ''
			};
		},

		components: {jyfParser},
		props: {},

		/**
		 * 生命周期函数--监听页面加载
		 */
		onLoad: function(options) {
			this.vc.onLoad(options);
			this.wgId = options.wgId;
			this.caId = options.caId;
		},

		/**
		 * 生命周期函数--监听页面初次渲染完成
		 */
		onReady: function() {},

		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow: function() {
			let _that = this;
			_that.loadActiviteFun();
		},
		/**
		 * 用户点击右上角分享
		 */
		onShareAppMessage: function() {},
		methods: {
			
			loadActiviteFun: function() {
				let _that = this;
				let _objData = {
					page: 1,
					row: 1,
					caId:getAreaId(),
					wgId: this.wgId
				};
				let _urlPath = '';
				// #ifdef MP-WEIXIN
				_urlPath = conf.baseUrl
				// #endif
				queryGovWorkGuide(_objData)
					.then((_acts) => {
						let _activites = _acts.data[0];
						_that.guideInfo =_activites;
						_that.startTime = _activites.createTime;
						_that.context = replaceImgSrc(_activites.flow,conf.commonBaseUrl);
						wx.setNavigationBarTitle({
						  title: _activites.title
						})
					});
			}
		}
	};
</script>
<style>
	@import "./govGuideDetail.css";
</style>
